Telegram Group & Telegram Channel
اسکریپت Lua برای ماژول بلوتوث

LEDpin = 4

gpio.mode(LEDpin, gpio.OUTPUT)--set LED pin as output pin
gpio.write(LEDpin, gpio.LOW)— set LED state initially low

—begin uart with specs
uart.setup(0, 9600, 8, uart.PARITY_NONE, uart.STOPBITS_1, 1)
—set callback function on receive to make decision about LED on/off
uart.on("data",1,
function(data)
if(data == "1") then
gpio.write(LEDpin, gpio.HIGH)
print("LED ON")
elseif(data == "2") then
gpio.write(LEDpin, gpio.LOW)
print("LED OFF")
else
print("select proper option")
end
end, 0)

نکته : پسورد دیفالت ماژول بلوتوث برای اتصال 0000 یا 1234 می باشد.

@micropython_iot



tg-me.com/micropython_iot/43
Create:
Last Update:

اسکریپت Lua برای ماژول بلوتوث

LEDpin = 4

gpio.mode(LEDpin, gpio.OUTPUT)--set LED pin as output pin
gpio.write(LEDpin, gpio.LOW)— set LED state initially low

—begin uart with specs
uart.setup(0, 9600, 8, uart.PARITY_NONE, uart.STOPBITS_1, 1)
—set callback function on receive to make decision about LED on/off
uart.on("data",1,
function(data)
if(data == "1") then
gpio.write(LEDpin, gpio.HIGH)
print("LED ON")
elseif(data == "2") then
gpio.write(LEDpin, gpio.LOW)
print("LED OFF")
else
print("select proper option")
end
end, 0)

نکته : پسورد دیفالت ماژول بلوتوث برای اتصال 0000 یا 1234 می باشد.

@micropython_iot

BY Micropython & IOT


Warning: Undefined variable $i in /var/www/tg-me/post.php on line 283

Share with your friend now:
tg-me.com/micropython_iot/43

View MORE
Open in Telegram


Micropython & IOT Telegram | DID YOU KNOW?

Date: |

Start with a fresh view of investing strategy. The combination of risks and fads this quarter looks to be topping. That means the future is ready to move in.Likely, there will not be a wholesale shift. Company actions will aim to benefit from economic growth, inflationary pressures and a return of market-determined interest rates. In turn, all of that should drive the stock market and investment returns higher.

A project of our size needs at least a few hundred million dollars per year to keep going,” Mr. Durov wrote in his public channel on Telegram late last year. “While doing that, we will remain independent and stay true to our values, redefining how a tech company should operate.

Micropython & IOT from sa


Telegram Micropython & IOT
FROM USA